<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
	  			xmlns:s="http://jboss.com/products/seam/taglib"
				xmlns:a4j="http://richfaces.org/a4j"
				xmlns:a="http://richfaces.org/a4j"
				xmlns:rich="http://richfaces.org/rich">
				
	<h:form>
		<a:commandButton value="View vouchers" action="#{userVouchers.findMoneyVouchers}" reRender="searchResults"/>
		&#160;
		<a:status>
			<f:facet name="start">
				<h:graphicImage value="/img/spinner.gif"/>
			</f:facet>
		</a:status>
	</h:form>
	<a:form>
		<a:outputPanel id="searchResults">
			<rich:datascroller align="left"  for="carList" maxPages="20" 
				rendered="#{vouchers.rowCount>0}"/>
			<rich:spacer height="30" />
			<rich:dataTable width="483" id="carList" rows="10" columnClasses="col"
				value="#{vouchers}" var="vouch"
				rendered="#{vouchers.rowCount>0}">
				<f:facet name="header">
					<rich:columnGroup>
						<h:column>
							<h:outputText styleClass="headerText" value="id" />
						</h:column>
						<h:column>
							<h:outputText styleClass="headerText" value="value" />
						</h:column>
						<h:column>
							<h:outputText styleClass="headerText" value="hash" />
						</h:column>			                        
					</rich:columnGroup>
				</f:facet>

				<h:column>
					<h:outputText value="#{vouch.id}" />
				</h:column>
				<h:column>
					<h:outputText value="#{vouch.value}" />
				</h:column>
				<h:column>
					<h:outputText value="#{vouch.voucherHash}" />
				</h:column>			                
			</rich:dataTable>
		</a:outputPanel>
	</a:form>				
				

</ui:composition>